<template>
  <div class="captcha">
    <img style="width: 70px; height: 30px" :src="img" @click="load" />
  </div>
</template>

<script>
import url from "../config/url";
export default {
  data() {
    return {
      img: "",
      key: "",
    };
  },
  methods: {
    chuan() {
      this.key;
    },
    load() {
      this.http();
    },
    http() {
      this.$http.get(url.captcha + "/" + "math").then((res) => {
        // console.log(res);
        this.key = res.data.key;
        //   console.log(this.key);
        this.img = res.data.img;
      });
    },
  },
  created() {
    this.http();
  },
};
</script>

<style lang="scss" scoped></style>
